package com.fusetech.flow.audit.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fusetech.flow.audit.domain.AuditRecord;
import com.fusetech.flow.audit.mapper.AuditRecordMapper;
import com.fusetech.flow.audit.service.dto.AuditRecordDTO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 审核记录表Service
 * @author Liuwq
 * @version 2023-05-09
 */
//@DS("zxhy_platform_db")
@Service
@Transactional
public class AuditRecordService extends ServiceImpl<AuditRecordMapper, AuditRecord> {

	/**
	 * 根据id查询
	 * @param id
	 * @return
	 */
	public AuditRecordDTO findById(String id) {
		return baseMapper.findById ( id );
	}

	/**
	 * 自定义分页检索
	 * @param page
	 * @param queryWrapper
	 * @return
	 */
	/*public IPage <AuditRecordDTO> findPage(Page <AuditRecordDTO> page, QueryWrapper queryWrapper) {
		queryWrapper.eq ("a.del_flag", 0 ); // 排除已经删除
		return  baseMapper.findList (page, queryWrapper);
	}*/

	public List<AuditRecordDTO> findList(Page <AuditRecordDTO> page, QueryWrapper queryWrapper) {
		queryWrapper.eq ("a.del_flag", 0 ); // 排除已经删除
		return  baseMapper.findList (page, queryWrapper).getRecords();
	}

	/*public List<AuditRecordDTO> findList(Page <AuditRecordDTO> page, QueryWrapper queryWrapper) {
		queryWrapper.eq ("a.del_flag", 0 ); // 排除已经删除
		return  baseMapper.selectList (page,queryWrapper);
		//return  baseMapper.selectList (page,queryWrapper);
	}*/

	/*public IPage <AuditRecordDTO> findList(Page <AuditRecordDTO> page, QueryWrapper queryWrapper) {
		queryWrapper.eq ("a.del_flag", 0 ); // 排除已经删除
		return  baseMapper.selectListNoP (queryWrapper);//page,
	}*/


	/*public AuditRecord selectOne(QueryWrapper queryWrapper) {
		queryWrapper.eq ("a.del_flag", 0 ); // 排除已经删除
		return  baseMapper.selectOne (queryWrapper);
	}*/
}
